/**********************************************************************************************************************
 *  COPYRIGHT
 *  -------------------------------------------------------------------------------------------------------------------
 *  \verbatim
 *  Copyright (c) 2017 by Vector Informatik GmbH.                                                  All rights reserved.
 *
 *                 This software is copyright protected and proprietary to Vector Informatik GmbH.
 *                 Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
 *                 All other rights remain with Vector Informatik GmbH.
 *  \endverbatim
 *
 *  -------------------------------------------------------------------------------------------------------------------
 *  SAMPLE CODE ONLY
 *  -------------------------------------------------------------------------------------------------------------------
 *              This implementation is sample code and only intended to illustrate an example of a possible BSW
 *              implementation. The implementation may not be complete and is not provided for use in production
 *              without any modifications. If this sample code is used in any way, the customer shall test
 *              this implementation as well as any of its modifications with diligent care.
 *
 *  -------------------------------------------------------------------------------------------------------------------
 *  FILE DESCRIPTION
 *  -------------------------------------------------------------------------------------------------------------------
 *              File: BswInit.c
 *       Description: Provides the implementation of the main function and unimplemented tasks
 *********************************************************************************************************************/
/**********************************************************************************************************************
 *  INCLUDES
 *********************************************************************************************************************/
#include "Os.h"
#include "EcuM.h"
#include "BswInit_Callout_Stubs.h"
/**********************************************************************************************************************
 *  ADDITIONAL USER INCLUDES
 *********************************************************************************************************************/
/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           <USERBLOCK User Includes>
 *********************************************************************************************************************/
#include "Fls.h"
#include "Mcu.h"
#include "Port.h"
#include "Wdg_59_DriverA.h"

/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           </USERBLOCK>
 *********************************************************************************************************************/


/**********************************************************************************************************************
 *  VERSION CHECK
 **********************************************************************************************************************/
#if ((BSWINIT_CALLOUT_STUBS_MAJOR_VERSION != 1U) || (BSWINIT_CALLOUT_STUBS_MINOR_VERSION != 0U))
# error "Vendor specific version numbers of BswInit_Callout_Stubs.h and BswInit.c are inconsistent"
#endif

/**********************************************************************************************************************
 *  FUNCTIONS
 **********************************************************************************************************************/

/***********************************************************************************************************************
 *  main
 **********************************************************************************************************************/
int main(void)
{
  BswInit_PreInitPowerOn();
  BswInit_InitializeOne();
  BswInit_InitializeTwo();
  EcuM_Init(); /* never returns */
  return 0;
}

/***********************************************************************************************************************
 *  IdleTask_OsCore_CORE0
 **********************************************************************************************************************/
TASK(IdleTask_OsCore_CORE0)
{
/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           <USERBLOCK IdleTask_OsCore_CORE0 begin block>
 *********************************************************************************************************************/

/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           </USERBLOCK>
 *********************************************************************************************************************/

  /* Empty Stub for "IdleTask_OsCore_CORE0" */
/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           <USERBLOCK IdleTask_OsCore_CORE0 end block>
 *********************************************************************************************************************/

/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           </USERBLOCK>
 *********************************************************************************************************************/

}

/***********************************************************************************************************************
 *  Default_Init_Task
 **********************************************************************************************************************/
TASK(Default_Init_Task)
{
/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           <USERBLOCK Default_Init_Task begin block>
 *********************************************************************************************************************/

/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           </USERBLOCK>
 *********************************************************************************************************************/

  EcuM_StartupTwo();
/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           <USERBLOCK Default_Init_Task end block>
 *********************************************************************************************************************/

/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           </USERBLOCK>
 *********************************************************************************************************************/

  (void)TerminateTask();
}
/***********************************************************************************************************************
 *  Default_Background_Task
 **********************************************************************************************************************/
TASK(Default_Background_Task)
{
/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           <USERBLOCK Default_Background_Task begin block>
 *********************************************************************************************************************/

/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           </USERBLOCK>
 *********************************************************************************************************************/

  for(;;)
  {
    (void)Schedule();
  }
/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           <USERBLOCK Default_Background_Task end block>
 *********************************************************************************************************************/

/**********************************************************************************************************************
 * DO NOT CHANGE THIS COMMENT!           </USERBLOCK>
 *********************************************************************************************************************/

}

/**********************************************************************************************************************
 *  END OF FILE: BswInit.c
 *********************************************************************************************************************/
